package com.zdx.yswl.base;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.view.inputmethod.InputMethodManager;

public abstract class KFragment extends Fragment {

		

		
		
		protected int getId4Resources(String __idName) {
			String __pkgName = getActivity().getPackageName();
			return getActivity().getResources().getIdentifier(__idName, "id", __pkgName);
		}

		public void hideKeyboard() {
			try {
				InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
				imm.hideSoftInputFromWindow(getView().getWindowToken(), 0); // 强制隐藏键盘
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
}
